package cz.possoft.explorer.resolver;

import java.util.Map;

import cz.possoft.explorer.context.FieldModifierEnum;

/**
 * Resolver can be used for working with fields (state) of some object and obtain value of particular field on target object.<br>
 * V is type of class for our object, which fields we need to obtain.<br>
 * C is type for keys, which will be used to identify fields from each other.
 * 
 * @author <a href="mailto:mposolda@gmail.com">Marek Posolda</a>
 * @version $Revision$
 */
public interface Resolver<V, C>
{
   /**
    * get names of all fields of particular object.
    * 
    * @param object
    * @return Map with fields
    */
   public Map<C, Class<?>> getFields(Class<? super V> clazz, V object);         
   
   /**
    * get value of particular field from the object. Field is identified by context variable.
    * 
    * @param object
    * @param context    
    * @return value of given field
    */
   public Object getFieldValue(V object, C context); 
   
   /**
    * get modifier of particular field from the object. Field is identified by context variable.
    * 
    * @param object
    * @param context    
    * @return value of given field
    */   
   public FieldModifierEnum getFieldModifier(V object, C context);    
   
   /**
    * 
    * 
    * @return class which should be the class for keys. Each resolver implementation should know his own class
    * for keys (identified by C)
    */
   public Class<C> getKeyClass();

}

